<template>
  <div>
    <h2>父组件</h2>
    <p>这个是父组件:{{ num }}</p>
    <hr>
    <!-- :value给子组件传入num的值 -->
    <!-- <Son :value="num" @input="value=>num=value" /> -->
    <!-- v-model是上面:value和@input的语法糖,代码更简洁 -->
    <Son v-model="num" />
  </div>
</template>
<script>
import Son from './Son.vue'
export default {
  components: {
    Son
  },
  data() {
    return {
      num: 100
    }
  }
}
</script>

